<!-- 圆形扩散 -->
<template>
  <div>
    <div class="container" :style="`border:1px solid ${borderColor}`">
      <div class="pulse" :style="`background: ${background};box-shadow: 1px 1px 20px ${background};`"></div>
      <div class="pulse1" :style="`background: ${background}`">
        <div class="pulse1after" :style="`height:${height}px`"></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    borderColor: {
      type: String,
      default: '#000'
    },
    background: {
      type: String,
      default: '#000'
    },
    height: {
      type: String,
      default: '50'
    }
  },
  data () {
    return {

    }
  }
}
</script>
<style lang='less' scoped>
@keyframes warn1 {
  0% {
    transform: scale(0.1);
  }

  10% {
    transform: scale(0.2);
  }

  20% {
    transform: scale(0.3);
  }

  30% {
    transform: scale(0.4);
  }

  40% {
    transform: scale(0.5);
  }
  50% {
    transform: scale(0.5);
  }
  60% {
    transform: scale(0.6);
  }

  70% {
    transform: scale(0.7);
  }

  80% {
    transform: scale(0.8);
  }

  90% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes warn {
  0% {
    transform: scale(0.1);
    opacity: 1;
  }

  10% {
    transform: scale(0.2);
    opacity: 0.9;
  }

  20% {
    transform: scale(0.3);
    opacity: 0.8;
  }

  30% {
    transform: scale(0.4);
    opacity: 0.7;
  }

  40% {
    transform: scale(0.5);
    opacity: 0.6;
  }
  50% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  60% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  70% {
    transform: scale(0.7);
    opacity: 0.3;
  }

  80% {
    transform: scale(0.8);
    opacity: 0.2;
  }

  90% {
    transform: scale(0.9);
    opacity: 0.1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.container {
  position: relative;
  width: 40px;
  height: 40px;
  // background:red;
  border-radius: 50%;
  border: 1px solid transparent;
}
.pulse1 {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  opacity: 0.8;
  z-index: 1;
}
.pulse1after{
  height: 50px;
  border-left: 1px dashed #57dae3;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

/* 产生动画（向外扩散变大）的圆圈  */
.pulse {
  position: relative;
  width: 40px;
  height: 40px;
  background: red;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  z-index: 1;
  opacity: 0;
  animation: warn 2s linear;
  animation-iteration-count: infinite;
  box-shadow: 1px 1px 20px red;
  transition: 0.3s;
}
</style>
